package com.youxue.service;

import com.youxue.dao.LineMapper;
import com.youxue.entity.Line;
import com.youxue.entity.LineDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by 15c on 2018/1/20.
 */
@Service("Line")
public class LineServiceImpl  implements LineService{
    @Autowired
    LineMapper lineMapper;


    @Override
    public List<Line> showAClassAllLine(Integer classId) {
        return lineMapper.selectAClassAllLine(classId);
    }

    @Override
    public List<Line> showAClassAllLineDetailAndLine(Integer classId) {
        return lineMapper.selectAClassAllLineDetailAndLine(classId);
    }


    @Override
    public Line showALineInfo(Integer lineId) {
        return lineMapper.selectByPrimaryKey(lineId);
    }

    @Override
    public int addLine(Line line) {
        return lineMapper.insertSelective(line);
    }

    @Override
    public int deleteLine(Integer lineId) {
        return lineMapper.deleteByPrimaryKey(lineId);
    }

    @Override
    public int updateALine(Line lineId) {
        return lineMapper.updateByPrimaryKeySelective(lineId);
    }
}
